﻿
namespace RoboTrocity.Code.ObjectStates {
	abstract class ObjectState {
		private float timeInState;
		private Sprite stateSprite;

		public ObjectState(Sprite newSprite) {
			timeInState = 0.0f;
			StateSprite = newSprite;
		}

		public void ResetState() {
			timeInState = 0;	
		}
		
		public void IncrementStateTime(float timePassed) {
			timeInState += timePassed;
		}
		
		public virtual void Update(float elapsed) {
			IncrementStateTime(elapsed);
		}
		
		public Sprite StateSprite {
			get { return stateSprite; }
			set { stateSprite = value; }
		}
		
		public float TimeInState {
			get { return timeInState; }
		}
	}
}
